package com.peng.spring.config;

import com.peng.spring.eg1.Product;
import com.peng.spring.file.Database;
import com.peng.spring.life.Life;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author peng
 * @Date 2024-04-17 14:22
 */
public class TestSpringConfig {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("com.peng.spring.config");
        Database database = context.getBean(Database.class);
        System.out.println("database = " + database);

        Product product = context.getBean(Product.class);
        System.out.println("product = " + product);

        Life life = context.getBean(Life.class);
        System.out.println("life = " + life);
        context.close();

    }
}
